home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14447 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  872 b 

  1. Path: news.ee.vill.edu!atangira
  2. From: atangira@monet.vill.edu (Arvind)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help:what is wrong this code?
  5. Date: 14 Apr 1996 21:49:48 GMT
  6. Organization: Villanova University
  7. Message-ID: <4krrts$sc5@ftp.ee.vill.edu>
  8. References: <4k3p3q$n76@brahms.udel.edu> <4kk1ug$agm@umbc9.umbc.edu>
  9. NNTP-Posting-Host: monet.csc.vill.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Jonas J. Schlein (schlein@umbc.edu) wrote:
  13. : Yue-hong Zheng <yuehong@brahms.udel.edu> wrote:
  14. : |> Why it give me 0.0000?
  15. : |> 
  16. : |> #include <stdio.h>
  17. : |> main () {
  18. : |> double a=9.008;
  19. : |> printf("%f\n",sqrt(a));
  20. : |> return 0;
  21. : |> }
  22.  
  23. : Have you tried adding the line: #include <math.h>?
  24.  
  25. Isn't it also true that one will have to link in the math library while
  26. compiling (-lm on UNIX, at the end of the command line) in order to use
  27. sqrt() or am I missing something?    
  28.  
  29. Arvind
  30.